<div class="flex-c hp100 border-box">
    <div class="search-box">
        <div class="condition-form">
            <el-form :inline="true" :model="formInline" ref="formInline" class="demo-form-inline">

                <template v-if="!queryInfo.fromPage">

                    <el-form-item class="mr10" label="刷卡/码(三合一扫码墩)">

                        <YbCard @back="back" ref="ybCard"></YbCard>
                
                    </el-form-item>

                    <el-form-item class="mr10" label="姓名" prop="BRXM">
                        <el-input type="text" v-model.trim="formInline.BRXM" placeholder="请输入" clearable
                            @keyup.enter.native="search_2()"></el-input>
                    </el-form-item>
                    <el-form-item class="mr10" label="就诊卡号" prop="BRBH">
                        <el-input type="text" v-model.trim="formInline.BRBH" placeholder="请输入" clearable
                            @keyup.enter.native="search_2()"></el-input>
                    </el-form-item>
                    <el-form-item class="mr10" label="住院号" prop="ZYH">
                        <el-input style="width: 120px;" type="text" v-model.trim="formInline.ZYH" placeholder="请输入" clearable
                            @keyup.enter.native="search_2()"></el-input>
                    </el-form-item>
                    <el-form-item class="mr10" label="放射科检查房间" prop="FJID">
                        <el-select clearable filterable placeholder="请选择" v-model="formInline.FJID" class="wp100" @change="search_2()">
                            <el-option v-for="item in FJ_LIST" :key="item.FJID" :label="item.FJMC"
                                :value="item.FJID">
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item class="mr10" label="签署状态" prop="ZTBZ">
                        <el-select  clearable filterable placeholder="请选择" v-model="formInline.ZTBZ" class="wp100" @change="search_2()">
                            <el-option key="1" label="待签署" :value="1">
                            </el-option>
                            <el-option key="2" label="已签署" :value="2">
                            </el-option>

                        </el-select>
                    </el-form-item>


                    <el-form-item class="mr10" label="签署模板" prop="TID">
                        <el-select clearable filterable placeholder="请选择" v-model="formInline.TID" class="wp100" @change="search_2()">
                            <el-option v-for="item in templateList" :key="item.TID" :label="item.MC" :value="item.TID">
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item class="mr10" label="所属科室" prop="filter_zkid">

                        <el-select v-model="formInline.filter_zkid" filterable placeholder="请选择" clearable class="wp100">
                          <el-option :label="item.ZKMC" :value="item.ZKID" v-for="item in ZK_LIST" :key="item.ZKID">
                          </el-option>
                        </el-select>
            
                      </el-form-item>

                      <el-form-item class="mr10" label="签署时间" prop="QSSJ">
                        <el-date-picker v-model="formInline.QSSJ" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
                            type="daterange" range-separator="至" :picker-options="pickerOptions" clearable
                            start-placeholder="开始日期" end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item>


                 

                    <!-- <el-form-item class="mr10" label="检查号" prop="JCH">
                        <el-input type="text" v-model.trim="formInline.JCH" placeholder="请输入" clearable
                            @keyup.enter.native="search()"></el-input>
                    </el-form-item> -->
                </template>

                <el-form-item class="mr10">
                    <el-button :disabled="listLoading" type="primary" @click="search_2()" icon="el-icon-search"
                        size="mini">查询
                    </el-button>
                    <template v-if="!queryInfo.fromPage">
                        <el-button type="warning" @click="resetForm('formInline')" icon="el-icon-close" size="mini">重置
                        </el-button>
                    </template>

                    <el-button type="success" @click="addConsent()" icon="el-icon-plus"
                        v-show="queryInfo.fromPage=='PATIENT_LIST'" size="mini">新增同意书
                    </el-button>

                    <span   v-show="queryInfo.fromPage=='PATIENT_LIST'" style="margin-left: 5px;">当前患者：{{formInline.BRXM}}（{{formInline.BRBH}}）</span>

                </el-form-item>
            </el-form>

        </div>
    </div>
    <el-table :data="tableData" border class="wp100" empty-text="暂无相关数据" height="250" v-loading="listLoading"     highlight-current-row
    >
        <el-table-column v-for="item in headers" :key="item.prop" :prop="item.prop" :label="item.label">
        </el-table-column>
        <el-table-column label="操作">
            <template slot-scope="scope">
                <span v-show="scope.row.ZTBZ==2" class="color-success">已签署</span>
                <span v-show="scope.row.ZTBZ==1" class="color-danger">待签署</span>

            </template>
        </el-table-column>
        <el-table-column label="操作" width="160px">
            <template slot-scope="scope">
                <el-button type="text" @click="seeRow(scope.row)" v-if="scope.row.ZTBZ==2">查看</el-button>
                <el-button type="text" @click="editRow(scope.row)" v-if="scope.row.ZTBZ!=2">修改</el-button>
                <el-button type="text" class="color-success" @click="selectTemp(scope.row)"
                    v-if="queryInfo.fromPage=='PATIENT_LIST'">新增同类</el-button>
                <el-button type="text" class="color-danger" @click="deleteRow(scope.row)">删除</el-button>

            </template>
        </el-table-column>


    </el-table>
    <pagination v-show="tableData.length>0" :total="listQuery.totalNum" :page.sync="listQuery.start"
        :limit.sync="listQuery.pageSize" @pagination="getList()" />
    <selectTemplate v-model="addShow" :ZKID="userInfo.ZKID" title="知情同意书模板选择" @cancelFun="addShow=false"
        @submitFun="selectTemp"></selectTemplate>
</div>